package com.ycsj.goldmedalnewconcept.ui;


import android.content.Context;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnPreparedListener;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.squareup.picasso.Picasso;
import com.ycsj.goldmedalnewconcept.R;

public class YuxiPager {
	View rootView;
	private LinearLayout ll_learn;
	private TextView tv_example;
//	private Button bt_phonetic;
	private ImageView lv_phonetic;
	private ImageView iv_pic;
	private TextView tv_soundmark;
	private LinearLayout ll_words;
	private String path;
	private MediaPlayer player;
	private TextView tv_paraphrase;
	private LinearLayout ll_yi;
	private LinearLayout ll_li;
	
	public YuxiPager(final Context context){
		
		rootView = View.inflate(context, R.layout.pager_yuxi, null);
		ll_learn = (LinearLayout) rootView.findViewById(R.id.ll_learn);
		ll_yi = (LinearLayout) rootView.findViewById(R.id.ll_yi);
		ll_li = (LinearLayout) rootView.findViewById(R.id.ll_li);
		
		tv_soundmark = (TextView) rootView.findViewById(R.id.tv_soundmark);
		tv_example = (TextView) rootView.findViewById(R.id.tv_example);
		 tv_paraphrase = (TextView) rootView.findViewById(R.id.tv_paraphrase);
//		bt_phonetic = (Button) rootView.findViewById(R.id.bt_phonetic);
		 lv_phonetic = (ImageView) rootView.findViewById(R.id.lv_phonetic);
		iv_pic = (ImageView) rootView.findViewById(R.id.iv_pic);
		
		ll_yi.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				tv_paraphrase.setVisibility(View.VISIBLE);
				tv_example.setVisibility(View.VISIBLE);
			}
		});
		ll_li.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				tv_paraphrase.setVisibility(View.VISIBLE);
				tv_example.setVisibility(View.VISIBLE);
			}
		});
		
	}
	
	public void setRootView(View rootView) {
		this.rootView = rootView;
	}

	public void setLl_learn(LinearLayout ll_learn) {
		this.ll_learn = ll_learn;
	}

	public void setTv_example(String text) {
		tv_example.setText(text);
	}
	
	public void setTv_paraphrase(String text) {
		tv_paraphrase.setText(text);
	}

	public void setTv_page(String text) {
	}
	
	public void setBt_phonetic(String path) {
		this.path=path;
	}

	public void setIv_pic(Context context,String path) {
		Picasso.with(context).load(path).into(iv_pic);
	}

	public void setTv_soundmark(String text) {
		tv_soundmark.setText(text);
	}

	public void setLl_words(LinearLayout ll_words) {
		this.ll_words = ll_words;
	}

	public View getView() {
		return rootView;
	}
}
